import './dynamicForm.js';
cqjs.component('formView', {
    template: `
        <div class="form-view">
            <div>
                <el-button size="mini" type="default" @click="$props.onGoBack">返回</el-button>
                <el-button size="mini" type="success" @click="$props.onCreate">创建</el-button>
                <el-button size="mini" type="primary" @click="$props.onSave">保存</el-button>
            </div>
            <dynamicForm
                ref="form"
                :data="$props.data"
                :arch="$props.arch"
                :meta="$props.meta"/>
          </div>
        </div>
    `,
    props: ['meta', 'arch', 'data', 'onGoBack', 'onCreate', 'onSave'],
    methods: {
        clearValidate(){
            this.$refs.form.$refs.form.clearValidate();
        }
    }
});